﻿using System;
using System.Text;

namespace MonopolyNOHI
{
    public class Dobbelsteen
    {
        private const int MaxAantalOgen = 6; // Voor verschillende dobbelstenen (o.a. D12 CRTIS!)
        private readonly Random _random;
        private int _aantalOgen;

        public Dobbelsteen()
        {
            _random = new Random(Guid.NewGuid().GetHashCode());
        }

        public int GetAantalOgen()
        {
            return _aantalOgen;
        }

        public void Gooi()
        {
            _aantalOgen = _random.Next(1, MaxAantalOgen);
        }

        public override string ToString()
        {
            var builder = new StringBuilder();

            builder.Append("Steen:\t" + GetHashCode() + "\t");
            builder.Append("Ogen:\t" + GetAantalOgen());

            return builder.ToString();
        }
    }
}